
// <copyright file="InjectableMethodInfo.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The injectable method info.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Reflection
{
    using System;
    using System.Reflection;

    using SubhadraSolutions.Sharp.Utils.Validation;

    /// <summary>
    /// The injectable method info.
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    public sealed class InjectableMethodInfo<T>
        where T : Attribute
    {
        #region Constructors and Finalizers

        /// <summary>
        /// Initializes a new instance of the <see cref="InjectableMethodInfo{T}"/> class.
        /// </summary>
        /// <param name="method">
        /// The method.
        /// </param>
        /// <param name="methodName">
        /// The method name.
        /// </param>
        /// <param name="attribute">
        /// The attribute.
        /// </param>
        public InjectableMethodInfo(MethodInfo method, string methodName, T attribute)
        {
            Guard.ArgumentNotNull(method, "method");
            Guard.ArgumentNotNullOrEmptyOrWhiteSpace(methodName, "methodName");
            Guard.ArgumentNotNull(attribute, "attribute");
            this.Method = method;
            this.MethodName = methodName;
            this.Attribute = attribute;
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets the attribute.
        /// </summary>
        public T Attribute { get; private set; }

        /// <summary>
        /// Gets the method.
        /// </summary>
        public MethodInfo Method { get; private set; }

        /// <summary>
        /// Gets the method name.
        /// </summary>
        public string MethodName { get; private set; }

        #endregion Public Properties
    }
}